package ru.tulupov.helloandroid;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.widget.TextView;

public class InfoActivity extends Activity {
	public static final String FIRST_NAME = "FIRST_NAME";
	public static final String LAST_NAME = "LAST_NAME";
	public static final String AGE = "AGE";

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_info);

		final Intent intent = getIntent();

		final TextView firstName = (TextView) findViewById(R.id.info_first_name);
		firstName.setText(Html.fromHtml(getString(R.string.info_first_name,
				intent.getCharSequenceExtra(FIRST_NAME))));
 
		final TextView lastName = (TextView) findViewById(R.id.info_last_name);
		lastName.setText(Html.fromHtml(getString(R.string.info_last_name,
				intent.getCharSequenceExtra(LAST_NAME))));

		final TextView age = (TextView) findViewById(R.id.info_age);
		age.setText(Html.fromHtml(getString(R.string.info_age,
				intent.getIntExtra(AGE, 0))));
	}

}
